<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="com.staff.model.emoplyee" %>
<%@ page import="java.util.*" %>
<%@ page import="com.staff.Util.JDBC_Staff" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>主界面</title>
</head>
<body>
	<% List<emoplyee> tList = new ArrayList<emoplyee>();%>
	<% String sql = "select * from employee"; %>
	<% Object[] obs = {}; %>
	<% tList = JDBC_Staff.getComplexResult(sql, obs, emoplyee.class);%>
	<table border='1'>
    	<tr><td>员工姓名</td>
		<td>员工性别</td>
		<td>员工年龄</td>
		<td>所属部门</td>
		<td>所在职位</td>
		<td>工龄</td>
		</tr>
		<%for(int i = 0;i<tList.size();i++){%>
			<tr>
			<td><%= tList.get(i).getName() %></td>
			<td><%= tList.get(i).getSex() %></td>
			<td><%= tList.get(i).getAge() %></td>
			<td><%= tList.get(i).getDapartment() %></td>
			<td><%= tList.get(i).getType() %></td>
			<td><%= tList.get(i).getYear() %></td>
			<td><a href="/Java_web/updateEmployee.jsp?id=<%= tList.get(i).getId()%>">修改</a></td>
			<td><a href="EmployeeServlet?category=remove&id=<%= tList.get(i).getId()%>">删除</a></td>
		<% } %>
		</tr>
		<tr><td><a href='/Java_web/addEmployee_Four.jsp'>新增员工信息</a></td></tr>
		</table>
</body>
</html>